﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMaster.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Microhard.Framework.MVCHelper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    公司管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="section-header">
        <div class="title">
            <img src="<%=Url.Content("~/Content/images/ico-catalog.png")%>" alt="" />
            公司管理
        </div>
        <div class="options">
        </div>
    </div>
    <table width="100%">
        <tr>
            <td class="adminTitle">
                <img alt="总部" src="<%=Url.Content("~/Content/images/ico-help.gif") %>" title="总部"></img><label
                    for="operationName" title="总部">总部</label>:
            </td>
            <td class="adminData">
                <%Html.RenderAction("GetHQList", "Company", new Microhard.WebUI.Models.AttriubteOfSelectList { ParameterModelName = "SelectedHQID", IsMulitiplySelect = false, DefaultSelectedText = "请选择", DefaultSelectedValue = Guid.Empty.ToString() });%>
            </td>
        </tr>
    </table>
    <p>
    </p>
    <table class="adminContent">
        <tr>
            <td>
                <%Html.Telerik().Grid<Microhard.Plat.CompanyChargingMng.Models.CompanyModel>((List<Microhard.Plat.CompanyChargingMng.Models.CompanyModel>)this.Model.Data)
                    .Name("operation-grid")
                    .ToolBar(t => t.Template(g =>
                    { %>
                <%var searchParms = new Dictionary<string, string>();
                  searchParms.Add("Com_CompanyID", "SelectedHQID");
                %>
                <div class="header-menu">
                    <ul class="t-widget t-reset t-header t-menu">
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_SearchButton("btnSearch", "查询", "operation-grid", searchParms, "OperationGridOnGridDataBinding")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_AddButton("btnAdd", "添加", "Create", "Company")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_UpdateButton("btnUpdate", "修改", "operation-grid", "Update", "Company", "PlatMng")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_DeleteButton("btnDelete", "删除", "operation-grid", "Delete", "Company", "PlatMng")%>
                        </li>
                    </ul>
                </div>
                <%}))
                         .ClientEvents(events => events.OnDataBinding("OperationGridOnGridDataBinding"))
                         .Columns(columns =>
                    {
                        columns.Bound(x => x.CompanyID)
                       .Template(x => Html.CheckBox("checkedRecords", new { value = x.CompanyID, @class = "gridCks" }))
                       .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= CompanyID #>' class='gridCks'/>")
                     .HtmlAttributes(new { style = "text-align:center" }).Title("选择");

                        columns.Bound(x => x.CompanyID).Title("公司ID");
                        columns.Bound(x => x.Name).Title("公司名称");
                    })
                      .Pageable(settings => settings.Total(Model.Total).PageSize(Html.GetGridPageSize()).Position(GridPagerPosition.Top))
                      //绑定搜索按钮，执行对应的action
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("_List", "Company"))
                    .EnableCustomBinding(true)
                    .Render();
                %>
            </td>
        </tr>
    </table>
</asp:Content>
